package com.shop.domain.article;

import java.util.Date;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.*;
import javax.persistence.Table;
import com.alibaba.fastjson.annotation.JSONField;
import com.shop.jpa.domain.BaseDomain;
import com.shop.jpa.support.JpaConst;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import lombok.Data;

/**
 * <p>Article 实体类</p>
 * <p>Table: t_article - 文章管理表</p>
 * @author generator
 * @date 2021-04-08 02:37:18
 */
@ApiModel("Article 实体类")
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "t_article")
@SQLDelete(sql = "update t_article set is_deleted = 1 where id = ?")
@Where(clause = JpaConst.WHERE_CLAUSE_NOT_DELETED)
@DynamicInsert(true)
@DynamicUpdate(true)
public class Article extends BaseDomain implements Serializable {

    @ApiModelProperty(value = "id", hidden = true)
	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
	@JSONField(serialize=false)
    private Long id;

    /**
	 * 分类id
	 */
    @ApiModelProperty("分类id")
	@Column(name = "cid")
    private String cid;

    /**
	 * 文章标题
	 */
    @ApiModelProperty("文章标题")
	@Column(name = "title")
    private String title;

    /**
	 * 文章作者
	 */
    @ApiModelProperty("文章作者")
	@Column(name = "author")
    private String author;

    /**
	 * 文章图片
	 */
    @ApiModelProperty("文章图片")
	@Column(name = "image_input")
    private String imageInput;

    /**
	 * 文章简介
	 */
    @ApiModelProperty("文章简介")
	@Column(name = "synopsis")
    private String synopsis;

    /**
	 * 文章分享标题
	 */
    @ApiModelProperty("文章分享标题")
	@Column(name = "share_title")
    private String shareTitle;

    /**
	 * 文章分享简介
	 */
    @ApiModelProperty("文章分享简介")
	@Column(name = "share_synopsis")
    private String shareSynopsis;

    /**
	 * 浏览次数
	 */
    @ApiModelProperty("浏览次数")
	@Column(name = "visit")
    private String visit;

    /**
	 * 排序
	 */
    @ApiModelProperty("排序")
	@Column(name = "sort")
    private Integer sort;

    /**
	 * 原文链接
	 */
    @ApiModelProperty("原文链接")
	@Column(name = "url")
    private String url;

    /**
	 * 状态
	 */
    @ApiModelProperty("状态")
	@Column(name = "status")
    private Integer status;

    /**
	 * 1删除0未删除
	 */
    @ApiModelProperty("1删除0未删除")
	@Column(name = "is_deleted")
    @JSONField(serialize=false)
    private Integer isDeleted;

    /**
	 * 添加时间
	 */
    @ApiModelProperty("添加时间")
	@Column(name = "create_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
	 * 修改时间
	 */
    @ApiModelProperty("修改时间")
	@Column(name = "update_time")
    @JSONField(serialize=false)
    private Date updateTime;

    /**
	 * 是否隐藏
	 */
    @ApiModelProperty("是否隐藏")
	@Column(name = "hide")
    private Integer hide;

    /**
	 * 管理员id
	 */
    @ApiModelProperty("管理员id")
	@Column(name = "admin_id")
    private Integer adminId;

    /**
	 * 商户id
	 */
    @ApiModelProperty("商户id")
	@Column(name = "mer_id")
    private Integer merId;

    /**
	 * 商品关联id
	 */
    @ApiModelProperty("商品关联id")
	@Column(name = "product_id")
    private Integer productId;

    /**
	 * 是否热门(小程序)
	 */
    @ApiModelProperty("是否热门(小程序)")
	@Column(name = "is_hot")
    private Integer isHot;

    /**
	 * 是否轮播图(小程序)
	 */
    @ApiModelProperty("是否轮播图(小程序)")
	@Column(name = "is_banner")
    private Integer isBanner;
}